
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>       

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script type="text/javascript">
            function doPopupMap() {
                var url = "${pageContext.request.contextPath}/property?viewMapForm&idBuilding=" + $('#idBuilding').val();
                window.open(url, "THv3","status=0,toolbar=0,location=0,menubar=0,width=950,height=700"); 
            }
        </script>


    </head>
    <body>
        <s:useActionBean beanclass="ipfms.stripes.util.ListUtil" var="list"/>
        <s:form beanclass="ipfms.stripes.property.PropertyAction" name="form1">
            <br/>
            <fieldset class="aras1">
                <legend>POST PROPERTY</legend>
                <p>
                    <label class="label1">Property Name</label>
                    <s:hidden name="building.idBuilding" id="idBuilding"/><s:text name="building.buildingName" size="35" id="building.buildingName"/>
                </p>
                <p>
                    <label class="label1">Property Address</label>
                    <s:text name="building.buildingAdd1" size="35"/>
                </p>
                <p>
                    <label class="label1">&nbsp;</label>
                    <s:text name="building.buildingAdd2" size="35"/>
                </p>
                <p>
                    <label class="label1">&nbsp;</label>
                    <s:text name="building.buildingAdd3" size="35"/>
                </p>
                <p>
                    <label class="label1">&nbsp;</label>
                    <s:text name="building.buildingAdd4" size="35"/>
                </p>
                <p>
                    <label class="label1">Postcode</label>
                    <s:text name="building.buildingPostcode" size="35" maxlength="5"/>
                </p>
                <p>
                    <label class="label1">State</label>
                    <s:select name="building.buildingState.code">                                                        
                        <s:options-collection collection="${list.senaraiNegeri}" label="desc" value="code"/>
                    </s:select>    
                </p>
                <p>
                    <label class="label1">Property Type</label>
                    <s:select name="building.buildingType.code">                                                        
                        <s:options-collection collection="${list.senaraiJenisBangunan}" label="desc" value="code"/>
                    </s:select>
                </p>
                <p>
                    <label class="label1">Year Of Completion</label>
                    <s:text name="building.yearCompletion" size="15" maxlength="4"/>
                </p>
                <p>
                    <label class="label1">Total number of floor</label>
                    <s:text name="building.totalFloor" size="15"/>
                </p>
                <p>
                    <label class="label1">Maximum unit per floor</label>
                    <s:text name="building.maxUnitPerFloor" size="15"/>
                </p>
                <p>
                    <label class="label1">Build Up</label>
                    <s:text name="building.buildUp" size="10"/> sq. ft
                </p>
                <p>
                    <label class="label1">Property Description</label>
                    <s:textarea cols="30" rows="10" name="building.buidingDesc"/>
                </p>

                <p>
                    <label class="label1">Images</label><s:file name="listOfImages[0]"/></p>
                <p>
                    <label class="label1">&nbsp;</label>
                    <s:file name="listOfImages[1]"/>
                </p>
                <p>
                    <label class="label1">&nbsp;</label>
                    <s:file name="listOfImages[2]"/>
                </p>
                <p>
                    <label class="label1">Map</label><s:button name="viewMapForm" value="add map" class="btn" onclick="doPopupMap();"/>
                    <s:text name="building.mapLocation" id="location" />
                    
                </p>
                
                <p id="mapBfrSave">
                    <label class="label1">&nbsp;</label>
                    <c:if test="${!empty actionBean.building.mapLocation}">
                    <img src="http://maps.googleapis.com/maps/api/staticmap?center=${actionBean.building.mapLocation}&&markers=color:blue|${actionBean.building.mapLocation}&zoom=16&size=400x400&sensor=false">
                    </c:if>
                </p>
                
                <p>
                    <label class="label1">&nbsp;</label>
                    <s:submit name="save" value="save" class="btn"/>

                </p>


            </fieldset>
        </s:form>
    </body>
</html>